﻿using System;
using System.Linq;
using System.Collections.Generic; 
using System.Data;
using Matrix.Common.Utility;
using Matrix.MaKaYunShang.Model;
using Matrix.MaKaYunShang.DAL;

namespace Matrix.MaKaYunShang.BLL
{
	public partial class OrderCouponBLL : BaseBLL<OrderCouponBLL>
	{
		#region 默认方法
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int  Add(OrderCoupon model)
		{
			return OrderCouponDAL.Instance.Add(model);		
		}

		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(OrderCoupon model)
		{
			return OrderCouponDAL.Instance.Update(model);
		}

		/// <summary>
		/// 删除一条数据
		/// </summary>
		public bool Delete(int Id)
		{			
			return OrderCouponDAL.Instance.Delete(Id);
		}
				/// <summary>
		/// 批量删除一批数据
		/// </summary>
		public bool DeleteList(string Idlist )
		{
			return OrderCouponDAL.Instance.DeleteList(Idlist );
		}
		
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public OrderCoupon GetModel(int Id)
		{
			var ds = OrderCouponDAL.Instance.GetModel(Id);
            return ds == null ? null : ServicesHelper.DataSetToIList<OrderCoupon>(ds).ToList()[0];
		}
		
		/// <summary>
		/// 获得数据列表
		/// </summary>
		public List<OrderCoupon> GetModelList(string strWhere = null)
		{
			var ds = OrderCouponDAL.Instance.GetList(strWhere);
			return ServicesHelper.DataSetToIList<OrderCoupon>(ds).ToList();
		}
		#endregion
		
		#region 扩展方法
		#endregion
	}
}